package cn.qayy.po;

import java.io.Serializable;
import java.util.Date;

import cn.qayy.dto.RegisterDTO;
import cn.qayy.utils.DateUtils;

/***
 * 注册库实体
 * 入货乙方，唯一约束 入货乙方相同认为注册库相同
 */
@SuppressWarnings("serial")
public class Register implements Serializable {
    //模板
    private String shengfen="";//省份
    private String city = "";//地市
    private String country = "";//区县
    private String cname = "";//入货乙方
    private String memo="";//备注
    private String zhengheqs="";//QS名
    private String addr = "";//分部
    private String terminaltype="";//渠道
    private String terminallve="";//级别
    private Integer id;
    //模板end
    //同步基础库
    private String mgr = "";//经理
    private String province = "";//大区
    private String space = "";//片区
    private String today = DateUtils.dateToString(new Date(),"yyyy/MM/dd HH:mm:ss");//录入时间
    private String dataer="";//录入人员
    private String flag="";//标识
    /**
	 * 通过DTO初始化
	 * @param dto
	 */
	public void setByDTO(RegisterDTO dto) {
		this.shengfen=dto.getShengfen();
		this.city=dto.getCity();
		this.country=dto.getCountry();
		this.cname=dto.getCname();
		this.memo=dto.getMemo();
		this.zhengheqs = dto.getZhengheqs();
		this.addr=dto.getAddr();
		this.terminaltype=dto.getTerminaltype();
		this.terminallve=dto.getTerminallve();
	}
	
    public String getFlag() {
		return flag;
	}

	public void setFlag(String flag) {
		this.flag = flag;
	}

	public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getZhengheqs() {
        return zhengheqs;
    }

    public void setZhengheqs(String zhengheqs) {
        this.zhengheqs = zhengheqs;
    }

    public String getToday() {
        return today;
    }

    public void setToday(String today) {
        this.today = today;
    }

    public String getCname() {
        return cname;
    }

    public void setCname(String cname) {
        this.cname = cname;
    }

    public String getAddr() {
        return addr;
    }

    public void setAddr(String addr) {
        this.addr = addr;
    }

    public String getMgr() {
        return mgr;
    }

    public void setMgr(String mgr) {
        this.mgr = mgr;
    }

    public String getSpace() {
        return space;
    }

    public void setSpace(String space) {
        this.space = space;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getDataer() {
        return dataer;
    }

    public void setDataer(String dataer) {
        this.dataer = dataer;
    }

    public String getTerminaltype() {
        return terminaltype;
    }

    public void setTerminaltype(String terminaltype) {
        this.terminaltype = terminaltype;
    }

    public String getTerminallve() {
        return terminallve;
    }

    public void setTerminallve(String terminallve) {
        this.terminallve = terminallve;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public String getShengfen() {
        return shengfen;
    }

    public void setShengfen(String shengfen) {
        this.shengfen = shengfen;
    }

	public Register() {
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((cname == null) ? 0 : cname.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Register other = (Register) obj;
		if (cname == null) {
			if (other.cname != null)
				return false;
		} else if (!cname.equals(other.cname))
			return false;
		return true;
	}
}
